/**
 * 
 *  @project Air Traff Monitor
 * 
 *  @author M.Emre ATASEVER <m.emre.atas@gmail.com>
 *  @author M.Burak ALKAN <mburakalkan@gmail.com>
 *  @author H.Burak KARAMIK <bkaramik@gmail.com>
 *
 *	`Air Traffic Monitor' is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	GNU General Public License for more details.
 *
 *	You should have received a copy of the GNU General Public License
 *	along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
 
#ifndef  KISFILTER_INC
#define  KISFILTER_INC

#include <QSortFilterProxyModel>
#include "filteredit.h"

class KismetSortFilterProxy : public QSortFilterProxyModel
{
	Q_OBJECT
public:
	KismetSortFilterProxy();
	bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
	
public slots:
	void setInvert(bool inv);
	void setCaseSensitive(bool cas);
	void setMode(filterMode mode);
	void setFilterString(const QString& string);
private:
	bool checkStarts(const QString &s);
	bool checkEnds(const QString &s);
	bool checkEq(const QString &s);
	bool checkRegExp(const QString &s);
	bool checkContains(const QString &s);
	bool binv,bex,bcas;
	filterMode mode;
	QString strexp;
};

#endif
